package STUDENT.TRINHQUANGXUANDUC.OPPS.QuanLyNhanSu.Controllers;

import java.io.IOException;
import java.util.List;

import javax.swing.JOptionPane;

import STUDENT.TRINHQUANGXUANDUC.OPPS.QuanLyNhanSu.Entry.Chamcong;
import STUDENT.TRINHQUANGXUANDUC.OPPS.QuanLyNhanSu.Entry.Nhanvien;
import STUDENT.TRINHQUANGXUANDUC.OPPS.QuanLyNhanSu.Entry.Phongban;
import STUDENT.TRINHQUANGXUANDUC.OPPS.QuanLyNhanSu.Models.Models;

public class Controllers {
	Models nsModels = new Models();

	public void addNhanvien(Nhanvien objNhanvien) {
		try {
			nsModels.nhapNhanviens(objNhanvien);
		} catch (NumberFormatException e) {
			JOptionPane.showMessageDialog(null, "Sai thong tin vui long kiem tra lai");
		} catch (IOException e) {
			// TODO Auto-generated catch block
			JOptionPane.showMessageDialog(null, "Loi nhap xuat");
		}
	}

	public String getListNhanviens() {
		return nsModels.getLIstNhanvien();
	}

	public void addPhongban(Phongban objPhongban) {
		nsModels.nhapPhongbans(objPhongban);
	}

	public String getListPhongban() {
		return nsModels.getPhongban();

	}

	public List<Nhanvien> getdanhsachNhanvien() {
		return nsModels.getdanhsachNhanvien();
	}

	public List<Phongban> getDanhSachPhongBan() {
		return nsModels.getdanhsachPhongban();
	}

	public String thongKe() {
		return nsModels.thongKe();
	}

	public void loaddata() {
		try {
			nsModels.loadData();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	public void addChamcong(Chamcong objChamcong) {
		nsModels.nhapChamcongs(objChamcong);
	}

	public String getListChamcong() {
		return nsModels.getListchamcong();
	}
}
